<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of editorclass
 *
 * @author skyline
 */
class editor {
    private $panel;

    function __construct($name, $type = null){
        if($type == null)
            $this->panel = ' new nicEditor().panelInstance(\''.$name.'\');';
        else
            $this->panel = ' new nicEditor({fullPanel : true}).panelInstance(\''.$name.'\');';
    }

    function add($name, $type = null){
        if($type == null)
            $this->panel .= ' new nicEditor().panelInstance(\''.$name.'\');';
        else
            $this->panel .= ' new nicEditor({fullPanel : true}).panelInstance(\''.$name.'\');';

    }

    function insert(){
        echo '<script type="text/javascript" src="../classes/editor/nicEdit.js"></script> <script type="text/javascript">bkLib.onDomLoaded(function() {';
        echo $this->panel;
        echo '});</script>';
    }
}
?>
